package com.badibadi.mail;

import com.badibadi.activity.ConsultingEvaluationActivity;
import com.badibadi.mytools.Utils;
import com.badibadi.uniclubber.R;
import com.badibadi.uniclubber.R.layout;
import com.badibadi.uniclubber.R.menu;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

//九、问方看到的，问方对答方第一次回答就满意，未评价之前----图23 ： $num=6 && $sender_rank='asker' && $is_agree='1'&& $is_pay='1' && $is_pleased='1' && $is_refund=1
//*     答方看到的，问方对答方第一次回答就满意，未评价之前----图25 ： $num=6 && $sender_rank='asker' && $is_agree='1'&& $is_pay='1' && $is_pleased='1' && $is_refund=1
/**9
 * 问方：第一次   满意
 * 答方：    交易成功
 * @author Administrator
 *
 */
public class Mail23_25Activity extends Mail245Activity {
	AlertDialog al_sheding;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		// setContentView(R.layout.activity_mail23_25);
	}

	@Override
	protected void DongTaiPeiZhi() {
		// TODO Auto-generated method stub
		
		TextView title_mail=(TextView)this.findViewById(R.id.title_mail);
		title_mail.setText(getResources().getString(R.string.wx_reply_zhanneixin));
		
		if (rank.equals("answerer")) {
			TextView tishi = (TextView) this.findViewById(R.id.tishi);
			tishi.setText(getResources().getString(R.string.wx_manyi_kuohao));
			tishi.setVisibility(View.VISIBLE);
			Button shedingzhixunfei = (Button) this
					.findViewById(R.id.shedingzhixunfei);
			shedingzhixunfei.setText(getResources().getString(R.string.wx_manyidu_diaocha));
			shedingzhixunfei.setVisibility(View.VISIBLE);
			shedingzhixunfei.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					LayoutInflater inflater=LayoutInflater.from(Mail23_25Activity.this);
		            View view=inflater.inflate(R.layout.manyi_dafangkandao, null);

		            
//		            //支付宝手续费
		            TextView alipay_charge=(TextView)view.findViewById(R.id.alipay_charge);
		            alipay_charge.setText(payUserContactShow1Model.getAlipay_charge());
		            //达人
		            TextView expert_charge=(TextView)view.findViewById(R.id.expert_charge);
		            expert_charge.setText(payUserContactShow1Model.getExpert_charge());
		            //一般用户
		            TextView member_charge=(TextView)view.findViewById(R.id.member_charge);
		            member_charge.setText(payUserContactShow1Model.getMember_charge());
		    
		     
		            
		            //退款工作日
		            TextView refund_time=(TextView)view.findViewById(R.id.refund_time);
		            refund_time.setText(payUserContactShow1Model.getRefund_time());
		            
		            //评价
		            Button queding=(Button)view.findViewById(R.id.queding);
		            queding.setOnClickListener(new View.OnClickListener() {
						
						@Override
						public void onClick(View v) {
							// TODO Auto-generated method stub
					          Intent intent=new Intent(Mail23_25Activity.this,ConsultingEvaluationActivity.class);
					          
					          intent.putExtra("uid", payUserContactShow1Model.getSent_uid());
					          intent.putExtra("chuanru_zhanneiId", payUserContactShow1Model.getZhannei_Id());
					          intent.putExtra("chuanru_asker_or_answerer", "answerer");
					          startActivity(intent);
						}
					});
		            
					al_sheding=new AlertDialog.Builder(Mail23_25Activity.this).setView(view).show();
				}
			});

		} else {//问方
			TextView tishi = (TextView) this.findViewById(R.id.tishi);
			tishi.setText(getResources().getString(R.string.wx_yi_reply_kuohao));
			tishi.setVisibility(View.VISIBLE);
			Button shedingzhixunfei = (Button) this
					.findViewById(R.id.shedingzhixunfei);
			shedingzhixunfei.setText(getResources().getString(R.string.wx_manyidu_diaocha));
			shedingzhixunfei.setVisibility(View.VISIBLE);
			shedingzhixunfei.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					LayoutInflater inflater=LayoutInflater.from(Mail23_25Activity.this);
		            View view=inflater.inflate(R.layout.manyi, null);
		            //退款工作日
		            TextView refund_time=(TextView)view.findViewById(R.id.refund_time);
		            refund_time.setText(payUserContactShow1Model.getRefund_time());
		            //确定
		            Button queding=(Button)view.findViewById(R.id.queding);
		            queding.setOnClickListener(new View.OnClickListener() {
						
						@Override
						public void onClick(View v) {
							// TODO Auto-generated method stub
							 Intent intent=new Intent(Mail23_25Activity.this,ConsultingEvaluationActivity.class);
								
					          intent.putExtra("uid", payUserContactShow1Model.getUid());
					          intent.putExtra("chuanru_zhanneiId", payUserContactShow1Model.getZhannei_Id());
					          intent.putExtra("chuanru_asker_or_answerer", "asker");
					          startActivity(intent);
						
						}
					});
		            
					al_sheding=new AlertDialog.Builder(Mail23_25Activity.this).setView(view).show();
					
					
				}
			});
		}

	}

}
